package com.example.backend.service.mysql.permission.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.backend.entitly.mysql.permission.Permissions;
import com.example.backend.mapper.mysql.permission.PermissionsMapper;
import com.example.backend.service.mysql.permission.PermissionsService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author 1
 * @description 针对表【permissions(权限表)】的数据库操作Service实现
 * @createDate 2025-06-04 09:01:51
 */
@Service
public class PermissionsServiceImpl extends ServiceImpl<PermissionsMapper, Permissions>
        implements PermissionsService {

    @Override
    public List<Permissions> getByPermissionId(List<Integer> permissionIds) {
        List<Permissions> list = new LambdaQueryChainWrapper<>(getBaseMapper())
                .in(Permissions::getPermissionId, permissionIds).list();
        if (list.isEmpty()) {
            return Collections.emptyList();
        }
        return list;
    }
}




